<template>
	<cl-dialog
		title="分配方案详情"
		width="800px"
		:visible.sync="visible"
		:props="{
			top: '10vh',
			appendToBody: true,
			closeOnClickModal: false
		}"
	>
		<el-table :data="list" border stript height="300px">
			<el-table-column label="固定金额" prop="amount"> </el-table-column>
			<el-table-column label="基数" prop="base">
				<template #default="{row}">
					{{ baseList.find(e => e.id == row.base)?.name }}
				</template>
			</el-table-column>
			<el-table-column label="分配方" prop="side">
				<template #default="{row}">
					{{ sideList.find(e => e.id == row.side)?.name }}
				</template>
			</el-table-column>
			<el-table-column label="比例(‰)" prop="ratio"></el-table-column>
			<el-table-column label="说明" prop="remark"></el-table-column>
		</el-table>
	</cl-dialog>
</template>

<script>
export default {
	data() {
		return {
			visible: false,
			list: [],
			baseList: [
				{ id: 1, name: "订单金额" },
				{ id: 2, name: "余额" }
			],
			sideList: [
				{ id: 1, name: "我方" },
				{ id: 2, name: "院方" },
				{ id: 3, name: "第三方" }
			]
		};
	},
	methods: {
		open(data = {}) {
			this.visible = true;
			console.log(data);

			this.list = data.allocation_content || [];
		}
	}
};
</script>

<style lang="scss" scoped>
::v-deep {
	.el-radio {
		margin-bottom: 10px !important;
	}
}
</style>
